﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;
using QuanLyBus.Model;

namespace QuanLyBus
{
    public partial class thong_tin_chi_tiet_tuyen : PhoneApplicationPage
    {
        QL_TuyenDataContext db = new QL_TuyenDataContext(App.constr);
        List<ds_tram> tram_dung = new List<ds_tram>();
        ds_tram t = new ds_tram();
        public thong_tin_chi_tiet_tuyen()
        {
            InitializeComponent();
            Load();
        }
        private void Load()
        {
            txb_tuyen.Text = "Tuyến số: " + App.id;
            tram_dung = (from c in db.ds_trams
                               join o in db.tram_thuoc_tuyens
                                on c.id_tram equals o.id_tram
                               where o.id_tuyen == App.id                              
                               select c).ToList();            
            this.list_tram.ItemsSource = tram_dung;
        }

        private void btn_trang_chinh_Click(object sender, EventArgs e)
        {
            this.NavigationService.Navigate(new Uri("/MainPage.xaml", UriKind.Relative));
        }
    }
}